package com.sixfoot.domain.scale;

import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.sixfoot.domain.Resource;
import com.sixfoot.domain.User;
import com.sixfoot.foundation.persistence.UUIDBaseModel;

/**
 * 记录
 * 
 * @author six-foot
 *
 */
@Entity
@Table(name = "scale")
public class Scale extends UUIDBaseModel {
	private User user;					// 用户
//	private ScaleType scaleType;  		// 记录类型：游戏、监测、放松中心
	private Resource resource;  		// 记录类型：游戏、监测、放松中心
	private Integer difficulty;   		// 难度
	private Set<ScaleMark> scaleMarks;	// 标记
	private Date startTime;				// 开始时间
	private Date stopTime;				// 结束时间
	private String ppg;					// 脉搏：[1.0,2.0,3.0,4.0]
	private String hrv; 				// 心率变异性：[1.0,2.0,3.0,4.0]
	private String artifact; 			// 伪信号，与HRV 1v1的关系（0是伪信号，1是正常信号）：[0, 1, 0, 1]
	private String ibi; 				// 即时心率：[1.0,2.0,3.0,4.0]
	private String spectrum;			// 频谱：[1.0,2.0,3.0,4.0]
	private String ep; 					// 评价：[1.0,2.0,3.0,4.0]
	private String remark;  			// 用户备注
	private String timeDomain; 			// 时域：[1.0,2.0,3.0,4.0]
	private String frequencyDomain; 	// 频域：[1.0,2.0,3.0,4.0]
	private String evaluation;			// 最终评价（10维的数组）
	
	public String getPpg() {
		return ppg;
	}
	public void setPpg(String ppg) {
		this.ppg = ppg;
	}
	public String getHrv() {
		return hrv;
	}
	public void setHrv(String hrv) {
		this.hrv = hrv;
	}
	public String getArtifact() {
		return artifact;
	}
	public void setArtifact(String artifact) {
		this.artifact = artifact;
	}
	public String getIbi() {
		return ibi;
	}
	public void setIbi(String ibi) {
		this.ibi = ibi;
	}
	public String getSpectrum() {
		return spectrum;
	}
	public void setSpectrum(String spectrum) {
		this.spectrum = spectrum;
	}
	public String getEp() {
		return ep;
	}
	public void setEp(String ep) {
		this.ep = ep;
	}
	public Integer getDifficulty() {
		return difficulty;
	}
	public void setDifficulty(Integer difficulty) {
		this.difficulty = difficulty;
	}
//	@ManyToOne
//	@JoinColumn(name = "scale_type_id")
//	public ScaleType getScaleType() {
//		return scaleType;
//	}
//	public void setScaleType(ScaleType scaleType) {
//		this.scaleType = scaleType;
//	}
	@ManyToOne
	@JoinColumn(name = "resource_id")
	public Resource getResource() {
		return resource;
	}
	public void setResource(Resource resource) {
		this.resource = resource;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getTimeDomain() {
		return timeDomain;
	}
	public void setTimeDomain(String timeDomain) {
		this.timeDomain = timeDomain;
	}
	public String getFrequencyDomain() {
		return frequencyDomain;
	}
	public void setFrequencyDomain(String frequencyDomain) {
		this.frequencyDomain = frequencyDomain;
	}
	@ManyToOne
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String getEvaluation() {
		return evaluation;
	}
	public void setEvaluation(String evaluation) {
		this.evaluation = evaluation;
	}
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getStopTime() {
		return stopTime;
	}
	public void setStopTime(Date stopTime) {
		this.stopTime = stopTime;
	}
	@OneToMany(mappedBy = "scale")
	public Set<ScaleMark> getScaleMarks() {
		return scaleMarks;
	}
	public void setScaleMarks(Set<ScaleMark> scaleMarks) {
		this.scaleMarks = scaleMarks;
	}
}
